package com.crm.service;

import org.springframework.transaction.annotation.Transactional;

import com.crm.dao.UserDao;
import com.crm.pojo.User;

@Transactional
public class UserService {
	
	private UserDao userDao;
	
	public User findByUser(User user) {
		String hql = "from User where userName = ? and password = ?";
		return userDao.findUnique(hql, user.getUserName(),user.getPassword());
	}
	
	public User findById(String userId) {
		String hql = "from User where id = ?";
		return userDao.findUnique(hql, userId);
	}
	
	
	//set
	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	
}
